$(function() {
	var id = getParameter("16-1.js", "id");

	$("#Button2").bind("click", function() {
				document.location = context + "/site/creditOrganization/16.jsp";
			})

	new $.grooveViewPreII({
				id : id,
				primaryTable : "loanapply"
			}, "audit-loan-apply", {
				formID : "formID",
				submitButtonID : "Button1",
				submitMessage : "确定提交贷款审核",
				OKMessage : "成功提交贷款申请",
				beforecall : function() {

				},
				aftercall : function() {
					document.location = context
							+ "/site/creditOrganization/16.jsp";
				},
				rendercall : function(selfFunc, validator, validators, data,
						resultData) {

					new $.grooveViewPreII({
								id : resultData.LA_LOANPRODUCTID,
								primaryTable : "financialProduct"
							}, "viewcreditproduct", {
								formID : "formView",
								beforecall : function() {

								},
								aftercall : function() {

								},
								rendercall : function(selfFunc, validator,
										validators, data) {

								}
							});

					new $.grooveViewPreII({
								id : resultData.LA_INDENID,
								primaryTable : "fcindent",
								foreignTables : [{
											foreignTable : "fcindentlist",
											listid : "fcorderlist"
										}]
							}, "viewfcorder", {
								formID : "formIndentView",
								beforecall : function() {

								},
								aftercall : function() {

								},
								rendercall : function(selfFunc, validator,
										validators, data) {

								}
							});
				}
			});

	$("#pageloading").hide();
});